<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8"></meta>
    <title>Title</title>
</head>
<body>
<div>
    <h1>If/Unless</h1>
    <a th:if="${flag == 'yes'}" th:href="@{http://favorites.ren/}"> home </a>
    <br/>
    <!--当if 不成立时，此<a>标签被隐藏-->
    <a th:if="${flag != 'no'}" th:href="@{http://www.ityouknow.com/}"> home </a>
</div>

</body>
</html>